package cn.edu.gcu.ssl.system.service;


import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.edu.gcu.ssl.system.service.impl.ISendMessage;
import net.sf.json.JSONObject;


@Service
public class SendMsgService {

	@Resource(name="sendMessagSerice")
	private ISendMessage messageService;
	
	
	
	
	public void sendMsText(String notifyWho,String text)
	{
	 
		Map<String,Object>map=new HashMap<String,Object>();
		String []s=notifyWho.split(",");
		List<String>openids=Arrays.asList(s);
		String type="2";
		JSONObject msg=messageService.getMsgText(text);	
		messageService.sendMessage(openids,type,msg);
	
	}
	public void sendMsLink(String notifyWho,String text)
	{
	 
		Map<String,Object>map=new HashMap<String,Object>();
		String []s=notifyWho.split(",");
		List<String>openids=Arrays.asList(s);
		String type="5";
		String opentype="110";
		JSONObject msg=messageService.getMsgLink(text,opentype);	
		messageService.sendMessage(openids,type,msg);
	
	}
	
	
	
	
	
}
